import Vue from 'vue'
import Vuex from 'vuex'
import catagtory from './modules/catagtory'
import newList from './modules/new-list'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    catagtory,
    newList
  },
  getters: {
    catagtory: state => state.catagtory.catagtory,
    currentCatagtory: function(state) {
      return state.catagtory.currentCatagtory
    },
    list: function(state) {
      return state.newList.allData[state.catagtory.currentCatagtory]
    }
  }
})
